package com.itheima.service.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.itheima.dao.MemberDao;
import com.itheima.pojo.Member;
import com.itheima.service.MemberService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;

/**
 * @version V1.0
 * @author: yongjichu
 * @date: 2020/2/6 16:33
 * @description:
 */
@Service(interfaceClass = MemberService.class)
@Transactional
public class MemberServiceImpl implements MemberService{
    @Autowired
    private MemberDao memberDao;
    /**
     * 根据电话号码查询是否是我们的用户
     *
     * @param telephone
     * @return
     */
    @Override
    public Member findByTelephone(String telephone) {
        Member member = memberDao.findByTelephone(telephone);
        return member;
    }

    /**
     * 根据手机号注册用户
     *
     * @param member
     * @return
     */
    @Override
    public Member add(Member member) {
        memberDao.add(member);
        return member;
    }
}
